package com.styletransfer.model;

import java.util.Date;

/**
 * 用户实体类
 * 
 * 这个类对应数据库中的user表，用于存储用户的基本信息。
 * 每个属性都与数据库表中的列相对应。
 */
public class User {
    
    private Long id;             // 用户ID，主键
    private String username;     // 用户名
    private String password;     // 密码（加密存储）
    private String nickname;     // 昵称
    private String avatar;       // 头像URL
    private String email;        // 电子邮件
    private String phone;        // 手机号码
    private Integer gender;      // 性别：0-未知，1-男，2-女
    private String bio;          // 个人简介
    private Date createTime;     // 创建时间
    private Date updateTime;     // 更新时间
    private Integer status;      // 状态：0-禁用，1-正常
    private String role;         // 角色：user-普通用户，admin-管理员
    
    // 构造函数
    public User() {
    }
    
    // Getters and Setters
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getUsername() {
        return username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    public String getPassword() {
        return password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    public String getNickname() {
        return nickname;
    }
    
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }
    
    public String getAvatar() {
        return avatar;
    }
    
    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
    
    public String getEmail() {
        return email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getPhone() {
        return phone;
    }
    
    public void setPhone(String phone) {
        this.phone = phone;
    }
    
    public Integer getGender() {
        return gender;
    }
    
    public void setGender(Integer gender) {
        this.gender = gender;
    }
    
    public String getBio() {
        return bio;
    }
    
    public void setBio(String bio) {
        this.bio = bio;
    }
    
    public Date getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    public Date getUpdateTime() {
        return updateTime;
    }
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    
    public Integer getStatus() {
        return status;
    }
    
    public void setStatus(Integer status) {
        this.status = status;
    }
    
    public String getRole() {
        return role;
    }
    
    public void setRole(String role) {
        this.role = role;
    }
    
    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", nickname='" + nickname + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", gender=" + gender +
                ", status=" + status +
                ", role='" + role + '\'' +
                '}';
    }
}
